package top.ochiamalu.aioj.converter;

import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import top.ochiamalu.aioj.domain.entity.User;
import top.ochiamalu.aioj.domain.vo.user.UserLoginVO;
import top.ochiamalu.aioj.domain.vo.user.UserVO;

/**
 * 用户转换器
 *
 * @author OchiaMalu
 * @date 2024/12/08
 */
@Mapper
public interface UserConverters {
    UserConverters INSTANCE = Mappers.getMapper(UserConverters.class);

    /**
     * 转换实体到登录vo
     *
     * @param user 用户
     * @return {@link UserLoginVO }
     */
    UserLoginVO convertEntity2LoginVO(User user);

    /**
     * 转换实体到vo
     *
     * @param user 用户
     * @return {@link UserVO }
     */
    UserVO convertEntity2VO(User user);
}
